<?php
class model_login extends CI_Model {

	public function __construct()
	{
	//ini_set('memory_limit', '-1');
		$this->load->database();
	}
	
	public function select($data)
	{
		$this->db->select('*');
		$this->db->from('tblusers');
		$this->db->join('tbldepartments', 'tbldepartments.rId = tblusers.rId', 'left');
		$this->db->where('uUsername', strtoupper($data["username"])); 
		$query = $this->db->get();
		return $query->row_array();
		//echo "SELECT us.*,de.rName FROM tblusers us LEFT JOIN tbldepartments de ON us.rId = de.rId WHERE uUsername='".strtoupper($data["username"])."'";
		//return mysql_query("SELECT us.*,de.rName FROM tblusers us LEFT JOIN tbldepartments de ON us.rId = de.rId WHERE uUsername='".strtoupper($data["username"])."'");
	}
}
	
?>